<script type="text/javascript"
     src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<head>
    <link rel="stylesheet" href="stylesheet_TMATS.css">
</head>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<title>
    T-MATS: Help for Valve Library Block
</title>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<body>
    <h1>
      T-MATS: Valve Library Block
    </h1>
<hr>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="purpose">
        Purpose
</div>

<p>
    This block is used to model the thermodynamic properties, mass flow rate of throat area of a valve, and the discharge coefficient.
</p>

<br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="background">
        Background
</div>

<p>
    To compute the mass flow rate and fluid properties of a fully developed incompressible and Newtonian fluid, this block utilizes
    predefined fluid property lookup tables and the discharge coefficient.
    <br>

$$ \dot{m} = C_d *A *\sqrt{2*g* \Delta{P}*\rho} $$

</p>

<br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="instructions">
        Instructions
</div>

<p>
    To use this block:
    <ul>
        <li> Connect the inputs of; upstream flow properties, independent variables pressure, throat area, and enthalpy to the corresponding ports.
        <li> Connect the outputs of; downstream flow properties and independent variable enthaply to the output ports.
        <li> Click on the mask to provide inputs for discharge coefficient(Cd).
    </ul>
</p>


<br><hr><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="inputs">
        Valve Inputs
</div>

<table>
    <tr><th> Input </th><th> Description </th></tr>
    <tr><td> InChar </td><td>Properties of inflow 4x1 bus of:
    <br> ht - enthalp \( [\frac{BTU}{lbm}]\)
    <br> Tt - temperature [<i>Rankine</i>]
    <br> Pt - pressure \([\frac{lb}{in^2}]\)
    <br> FAR - fuel to air ratio [N/A]</td></tr>
    <tr><td> PtOutVol </td><td>Independent pressure at exit of pipe \([\frac{lb}{in^2}]\)</td></tr>
    <tr><td> htOutVol </td><td>Independent enthalpy at exit of pipe \([\frac{BTU}{lbm}]\)</td></tr>
    <tr><td> Area </td><td>Valve throat area \([in^2]\)</td></tr>
</table>

<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="outputs">
        Valve Outputs
</div>

<table>
    <tr><th> Output </th><th> Description </th></tr>
    <tr><td>FlowOut</td><td>Properties of inflow 5x1 bus of:
    <br> W - mass flow rate \( [\frac{lbm}{sec}]\)
    <br> ht - enthalp [\( \frac{BTU}{lbm}\)]
    <br> Tt - temperature [<i>Rankine</i>]
    <br> Pt - pressure \([\frac{lb}{in^2}]\)
    <br> FAR - fuel to air ratio [N/A]</td></tr>
    <tr><td> htTotVol </td><td>Independent enthalpy at exit of pipe \( [\frac{BTU}{lbm}]\)</td></tr>
</table>

<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="maskvars">
        Valve Mask Variables
</div>

<table>
    <tr><th> Mask Variable </th><th> Description </th></tr>
    <tr><td> Cd_M </td><td> Discharge coefficienct </td></tr>
    <tr><td> htVec_M </td><td> Enthalpy vector for table lookup \( [\frac{BTU}{lbm}]\)</td></tr>
    <tr><td> PtVec_M </td><td>Pressure vector for table lookup \([\frac{lb}{in^2}]\)</td></tr>
    <tr><td> TtArray_M </td><td>Total temperature array a function of enthalpy and pressure f(ht,Pt) \( [Rankine]\)</td></tr>
    <tr><td> rhoArray_M </td><td>Density array a function of enthalpy and pressure f(ht,Pt) \( [\frac{lbm}{in^3}]\)</td></tr>
</table>


<br><hr><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class = "errors">
    Potential Errors
</div>
<p>
When using this block, you may receive one of the following errors/warnings. The table
below lists the errors/warnings that you may see and the reason why it is being displayed.
</p>
<table>
    <tr><th> Error/Warning </th><th>Description</th></tr>
    <tr><td>...</td><td>...</td></tr>
    <tr><td>...</td><td>...</td></tr>
</table>




<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
</body>